package website.haicheng.cloudauth.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import website.haicheng.core.base.BaseEntity;
import website.haicheng.core.validated.groups.InsertGroup;
import website.haicheng.core.validated.groups.UpdateGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @description:
 * @author: 582895699@qq.com
 * @time: 2021/2/19 下午 08:59
 */
@Getter
@Setter
@ApiModel(description = "菜单、角色实体类")
public class MenuDto extends BaseEntity {
    private static final long serialVersionUID = 7260444023049270030L;

    @NotNull(message = "[id]不可为空", groups = UpdateGroup.class)
    @ApiModelProperty(value = "Id")
    private Long id;

    @NotNull(message = "父菜单Id不可为空", groups = {InsertGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "父菜单Id")
    private Long parentId;

    @NotBlank(message = "菜单名称不可为空", groups = {InsertGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "菜单名称")
    private String menuName;

    @NotBlank(message = "权限不可为空", groups = {InsertGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "权限")
    private String permission;

    @NotNull(message = "菜单状态不可为空", groups = {InsertGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "1:表示删除；0:表示未删除")
    private Integer isDelete;


    @NotBlank(message = "菜单图标不可为空", groups = {InsertGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @NotNull(message = "排序不可为空", groups = {InsertGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @NotBlank(message = "类型不可为空", groups = {InsertGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "类型；D:表示目录; M:表示菜单；B:表示按钮")
    private String type;
}
